import { Module, forwardRef } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UserService } from './user.service';
import { UserController } from './user.controller';
import { User } from './entities/user.entity';
import { AuthModule } from '../auth/auth.module';
import { WeChatModule } from '@/common/platform/wechat/wechat.module';
import { RedisModule } from '@/common/redis/redis.module';
import { JwtCommonModule } from '@/common/jwt/jwt.module';
import { UploadModule } from '@/common/upload/upload.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([User]),
    forwardRef(() => AuthModule),
    forwardRef(() => WeChatModule),
    forwardRef(() => UploadModule),
    RedisModule, // 直接导入RedisModule，不需要forwardRef
    JwtCommonModule,
  ],
  providers: [UserService],
  controllers: [UserController],
  exports: [UserService],
})
export class UserModule {}
